package cn.hollis.nft.turbo.test.controller;

import cn.hollis.nft.turbo.test.entity.User;
import cn.hollis.nft.turbo.test.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class UserController {

    @Autowired
    private UserService userService;


    @RequestMapping("/find")
    public User testInsert(){
      return   userService.findById(10l);
    }

    @RequestMapping("/update")
    public Boolean testUpdate(){
        User user = new User();
        user.setId(10l);
        user.setUsername("fangbin_update");
        user.setPassword("123456_update");
        return userService.modify(user);
    }
}
